package com.dc.designPattern._23_specification.impl.step3.spec;

import com.dc.designPattern._23_specification.impl.step3.User;

/**
 * Description: 用户规格接口
 * @author: gdc
 * @date: 2021/8/20
 * @version 1.0
 */
public interface IUserSpecification {

    /**
     * 候选者是否满足需求
     * @param user
     * @return
     */
    boolean isSatisfiedBy(User user);

    /**
     * and操作
     * @param spec
     * @return
     */
    IUserSpecification and(IUserSpecification spec);

    /**
     * or操作
     * @param spec
     * @return
     */
    IUserSpecification or(IUserSpecification spec);

    /**
     * not操作
     * @return
     */
    IUserSpecification not();
}
